package com.hibase.core.excel.controller;

import com.github.pagehelper.PageInfo;
import com.hibase.common.entity.ResponseModel;
import com.hibase.common.util.EntityUtil;
import com.hibase.core.excel.service.MdsExcelImportLogService;
import com.hibase.core.excel.vo.bizlog.MdsExcelImportLogListVO;
import com.hibase.core.excel.vo.bizlog.MdsExcelImportLogSearchVO;
import com.hibase.core.web.annotation.HibasePostRequestMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Excel 导入日志
 *
 * @author <a href="mailto:xiongliyi@hichain.com">Ian Xiong</a>
 * @since 1.5.01-V2
 */
@AllArgsConstructor
@Api(value = "mds-excel-importLogDetail", tags = "Excel导入日志管理")
@RequestMapping("/mds-excel-importLogDetail")
@RestController
public class MdsExcelImportLogController {
    private final MdsExcelImportLogService mdsExcelImportLogService;

    @ApiOperation("分页查询")
    @HibasePostRequestMapping("/list")
    public ResponseModel<MdsExcelImportLogListVO> queryPage(@RequestBody MdsExcelImportLogSearchVO searchVO) {
        PageInfo page = mdsExcelImportLogService.queryPage(searchVO);
        page.setList(EntityUtil.transform(page.getList(), MdsExcelImportLogListVO.class));
        return ResponseModel.successMsg(page);
    }

}
